package com.lm.upms.api.feign;

import com.lm.common.core.constant.ServiceNameConstants;
import com.lm.common.core.util.R;
import com.lm.upms.api.dto.UserInfo;
import com.lm.upms.api.feign.factory.RemoteUserServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 用户
 *
 * @author lm
 * @date
 */
@FeignClient(contextId = "remoteUserService", name = ServiceNameConstants.SERVICE_UMPS, fallbackFactory = RemoteUserServiceFallbackFactory.class)
public interface RemoteUserService {

    /**
     * 根据用户名查用户信息
     *
     * @param username
     * @return
     */
    @GetMapping("/user/info/{username}")
    R<UserInfo> findByUsername(@PathVariable("username") String username);

}